

/*function find(){
    var search_site = document.getElementById("username").value;
    var str = localStorage.getItem(search_site);
    // var site = JSON.parse(str);

    // document.write(str.siteurl);

    if(str==null)
    {
        alert("用户名不存在");
        return false;
    }

    var site = JSON.parse(str);

    if(document.getElementById("pwd").value!=site.siteurl)
    {
        alert("密码不存在");
        return false;
    }
    sessionStorage.username =search_site;
    window.location.href='';
}
function check()
{
    var username=sessionStorage.key(sessionStorage.length);
    if(sessionStorage.length==0)
    {
        alert("登录失败！");

        self.location.href="";

    }


    else { var list = document.getElementById("okname");
        list.innerHTML =sessionStorage.getItem("username");
        loadAll();
    }
}*/

$(document).ready(function(){

    var strName = localStorage.getItem('UserName');
    var strPass = localStorage.getItem('UserPass');
    if(strName){
        $('#username-text').val(strName);
    }if(strPass){
        $('#password-text').val(strPass);
    }

});

function loginBtn_click(){
    debugger
    var strName = $('#username-text').val();
    var strPass = $('#password-text').val();
    localStorage.setItem('UserName',strName);
    if($('#remember-me').is(':checked')){
        localStorage.setItem('UserPass',strPass);
    }else{
        localStorage.removeItem('UserPass');
    }
    window.location.reload();
}